// mock数据模拟
import Mock from 'mockjs'

// 图表数据
let List = []
export default {
  getStatisticalData: () => {
    //Mock.Random.float 产生随机数100到8000之间 保留小数 最小0位 最大0位
    for (let i = 0; i < 7; i++) {
      List.push(
        Mock.mock({
          苹果: Mock.Random.float(100, 8000, 0, 0),
          vivo: Mock.Random.float(100, 8000, 0, 0),
          oppo: Mock.Random.float(100, 8000, 0, 0),
          魅族: Mock.Random.float(100, 8000, 0, 0),
          三星: Mock.Random.float(100, 8000, 0, 0),
          小米: Mock.Random.float(100, 8000, 0, 0)
        })
      )
    }
    return {
      code: 20000, //状态码
      data: {
        // 饼图
        videoData: [
          {
            name: '小米',
            value: 2999
          },
          {
            name: '苹果',
            value: 5999
          },
          {
            name: 'vivo',
            value: 1500
          },
          {
            name: 'oppo',
            value: 1999
          },
          {
            name: '魅族',
            value: 2200
          },
          {
            name: '三星',
            value: 4500
          }
        ],
        // 柱状图
        userData: [
          {
            date: '周一',
            new: 5,
            active: 200
          },
          {
            date: '周二',
            new: 10,
            active: 500
          },
          {
            date: '周三',
            new: 12,
            active: 550
          },
          {
            date: '周四',
            new: 60,
            active: 800
          },
          {
            date: '周五',
            new: 65,
            active: 550
          },
          {
            date: '周六',
            new: 53,
            active: 770
          },
          {
            date: '周日',
            new: 33,
            active: 170
          }
        ],
        // 折线图
        orderData: {
          date: [
            '20191001',
            '20191002',
            '20191003',
            '20191004',
            '20191005',
            '20191006',
            '20191007'
          ],
          data: List
        },
        // tableData: [
        //   {
        //     name: 'oppo',
        //     todayBuy: 500,
        //     monthBuy: 3500,
        //     totalBuy: 22000
        //   },
        //   {
        //     name: 'vivo',
        //     todayBuy: 300,
        //     monthBuy: 2200,
        //     totalBuy: 24000
        //   },
        //   {
        //     name: '苹果',
        //     todayBuy: 800,
        //     monthBuy: 4500,
        //     totalBuy: 65000
        //   },
        //   {
        //     name: '小米',
        //     todayBuy: 1200,
        //     monthBuy: 6500,
        //     totalBuy: 45000
        //   },
        //   {
        //     name: '三星',
        //     todayBuy: 300,
        //     monthBuy: 2000,
        //     totalBuy: 34000
        //   },
        //   {
        //     name: '魅族',
        //     todayBuy: 350,
        //     monthBuy: 3000,
        //     totalBuy: 22000
        //   }
        // ]
        tableData: [
          {
            name: 'oppo',
            todayBuy: 100,
            monthBuy: 300,
            totalBuy: 800
          },
          {
            name: 'vivo',
            todayBuy: 100,
            monthBuy: 300,
            totalBuy: 800
          },
          {
            name: '苹果',
            todayBuy: 100,
            monthBuy: 300,
            totalBuy: 800
          },
          {
            name: '小米',
            todayBuy: 100,
            monthBuy: 300,
            totalBuy: 800
          },
          {
            name: '魅族',
            todayBuy: 100,
            monthBuy: 300,
            totalBuy: 800
          },
          {
            name: '华为',
            todayBuy: 150,
            monthBuy: 390,
            totalBuy: 800
          },
          {
            name: '至荣',
            todayBuy: 180,
            monthBuy: 310,
            totalBuy: 600
          },
          {
            name: '一加',
            todayBuy: 95,
            monthBuy: 320,
            totalBuy: 780
          },
          {
            name: '诺基亚',
            todayBuy: 80,
            monthBuy: 280,
            totalBuy: 750
          },
          {
            name: '联想',
            todayBuy: 110,
            monthBuy: 310,
            totalBuy: 790
          },
          {
            name: 'HTC',
            todayBuy: 90,
            monthBuy: 270,
            totalBuy: 760
          },
          {
            name: '索尼',
            todayBuy: 105,
            monthBuy: 295,
            totalBuy: 765
          },
          {
            name: 'LG',
            todayBuy: 85,
            monthBuy: 305,
            totalBuy: 785
          },
          {
            name: '黑莓',
            todayBuy: 75,
            monthBuy: 315,
            totalBuy: 795
          },
          {
            name: '华硕',
            todayBuy: 115,
            monthBuy: 285,
            totalBuy: 755
          },
          {
            name: '宏碁',
            todayBuy: 100,
            monthBuy: 275,
            totalBuy: 770
          },
          {
            name: '夏普',
            todayBuy: 92,
            monthBuy: 290,
            totalBuy: 780
          },
          {
            name: '酷派',
            todayBuy: 88,
            monthBuy: 305,
            totalBuy: 775
          },
          {
            name: '中兴',
            todayBuy: 112,
            monthBuy: 285,
            totalBuy: 765
          },
          {
            name: '金立',
            todayBuy: 96,
            monthBuy: 300,
            totalBuy: 780
          },
          {
            name: '天语',
            todayBuy: 102,
            monthBuy: 270,
            totalBuy: 760
          },
          {
            name: '海信',
            todayBuy: 89,
            monthBuy: 310,
            totalBuy: 790
          },
          {
            name: '康佳',
            todayBuy: 107,
            monthBuy: 280,
            totalBuy: 750
          },
          {
            name: 'TCL',
            todayBuy: 93,
            monthBuy: 295,
            totalBuy: 770
          },
          {
            name: '三星',
            todayBuy: 100,
            monthBuy: 300,
            totalBuy: 800
          },
          {
            name: '朵唯',
            todayBuy: 87,
            monthBuy: 275,
            totalBuy: 755
          },
          {
            name: '纽曼',
            todayBuy: 103,
            monthBuy: 315,
            totalBuy: 785
          }
        ]
      }
    }
  }
}
